﻿using ProjBackEnd.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ProjBackEnd.Areas.BizPurview.Models
{
    public class ResultProjPurview : BaseResultInfo
    {
        /// <summary>
        /// 项目成员列表
        /// </summary>
        public List<ProjPurviewExtInfo> purviewlist { get; set; } = new List<ProjPurviewExtInfo>();
    }

    public class ReqProjPurview : BaseUserRequest
    {
        /// <summary>
        /// 项目权限基本信息
        /// </summary>
        [Required(ErrorMessage ="项目权限信息是必需的")]
        public ProjPurviewBaseInfo purviewinfo { get; set; } = new ProjPurviewBaseInfo();
    }

    /// <summary>
    /// i 项目权限基本信息
    /// </summary>
    public class ProjPurviewBaseInfo : BaseOperableEntity
    {
        /// <summary>
        /// 项目id
        /// </summary>
        [Required(ErrorMessage = "项目id是必需的")]
        public int projid { get; set; }
        /// <summary>
        /// 项目成员id
        /// </summary>
        [Required(ErrorMessage = "项目成员是必需的")]
        public string memberid { get; set; } = "";
    }

    /// <summary>
    /// ii 项目权限扩展信息
    /// </summary>
    public class ProjPurviewExtInfo : ProjPurviewBaseInfo
    {
        /// <summary>
        /// 项目成员姓名
        /// </summary>
        public string membername { get; set; } = "";
    }


    public class ResultPurviewMgr : BaseResultInfo
    {
        /// <summary>
        /// 权限管理员列表
        /// </summary>
        public List<PurviewMgrExtInfo> purmgrlist { get; set; } = new List<PurviewMgrExtInfo>();
    }

    /// <summary>
    /// 权限管理员操作请求
    /// </summary>
    public class ReqPurviewMgr : BaseUserRequest
    {
        /// <summary>
        /// 权限管理员信息
        /// </summary>
        public PurviewMgrCore purmgrinfo { get; set; } = new PurviewMgrCore();
    }

    /// <summary>
    /// i 权限管理核心
    /// </summary>
    public class PurviewMgrCore : BaseOperableEntity
    {
        /// <summary>
        /// 权限管理类别（对应CD_BASIC.ATTRCD = 'PURTP'）
        /// </summary>
        [Required(ErrorMessage ="权限管理类别是必需的")]
        public string purtp { get; set; }
        /// <summary>
        /// 权限管理员ID
        /// </summary>
        [Required(ErrorMessage = "权限管理员ID是必需的")]
        public string memberid { get; set; }
    }

    /// <summary>
    /// ii 权限管理扩展信息
    /// </summary>
    public class PurviewMgrExtInfo : PurviewMgrCore
    {
        /// <summary>
        /// 权限管理类别名称
        /// </summary>
        public string purtpnm { get; set; } = "";
        /// <summary>
        /// 权限管理员姓名
        /// </summary>
        public string mgrnm { get; set; } = "";
    }

}